import java.util.Random;
import java.util.ArrayList;

public class Deck {
	private ArrayList<Card> cards; // zamienic na LinkedList

	static String[] colors = { "trefl", "karo", "kier", "pik" };
	static String[] indexes = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "walet", "dama", "krol", "as" };

	Deck() {
		cards = new ArrayList<Card>();

		for (short color = 1; color <= 4; color++) {
			for (short index = 1; index <= 13; index++) {
				cards.add(new Card(color, index));
			}
		}

		Random random = new Random();
		int index_1, index_2;
		Card tmp;

		for (int i = 0; i <= 1000; i++) {
			index_1 = random.nextInt(55);
			index_2 = random.nextInt(55);

			tmp = cards.get(index_2);
			cards.set(index_2, cards.get(index_1)); // set nadpisuje
			cards.set(index_1, tmp);
		}
	}

	public Card drawFromDeck() {
		return cards.remove(0); //zwraca usuwana karte
	}
}
